/**
 * 
 */
package com.scpii.universal.hibernate.dao.impl;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.scpii.universal.constant.GenericConstants;
import com.scpii.universal.dto.ContentImgDtoForPru;
import com.scpii.universal.hibernate.dao.ContentImgDao;
import com.scpii.universal.hibernate.entity.ContentImgTab;

/**
 * genericWeb
 * @author weny
 * 2012-7-6上午10:53:35
 */
@Repository
public class ContentImgDaoImpl extends BaseDaoImpl<ContentImgTab, Integer> implements
		ContentImgDao {

	@SuppressWarnings("unchecked")
	@Override
	public List<ContentImgDtoForPru> getImgsInfoById(int contentId) {
		String hql = "select new com.scpii.universal.dto.ContentImgDtoForPru(c.intImgId,c.varImgUrl,c.varImgDescrip) " +
				"from ContentImgTab c where c.intDeleteSign=? and c.intContentId=?";
		return getHibernateTemplate().getSessionFactory().getCurrentSession()
				.createQuery(hql).setParameter(0,
						GenericConstants.DELETE_SIGN_EXIST).setParameter(1,
						contentId).list();
	}
	
	
}
